Generative Adversarial Networks (GANs)
What is GAN?
= A framework to train generative models via adversarial process.
Architecture
- Generator (G)
- Creates fake data from random noise
- Takes noise vector z (sampled from e.g., Gaussian) → outputs synthetic data
- Discriminator (D)
- Tries to distinguish real data from fake data
- Takes data (real or fake) → outputs probability of being real
How it works
-
"adversarial"
- G tries to fool D by producing realistic samples
- D tries to correctly classify real vs fake
- Both networks train simultaneously in a minimax game
Training Process
- Sample real data batch
- Sample noise batch
- Train D on real and fake data
- Train G to fool D
- Repeat until convergence
Loss Functions
- Discriminator loss:
- Generator loss:
Challenges
- Training instability
- Mode collapse (generator produces limited diversity)
- Balancing G and D power